<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>首页</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css" >
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
</head>

<body>
    <!--导航-->
    <nav th:replace="_fragments :: menu(1)" class="ui  inverted attached segment m-padded-tb-mini m-shadow-small">
        <div class="ui container">
            <div class="ui inverted secondary stackable menu ">
                <h2 class="ui teal header item ">Blog</h2>
                <a href="#" class="m-item item m-mobile-hide"><i class=" home icon "></i>首页</a>
                <a href="#" class="m-item item m-mobile-hide"><i class=" idea icon"></i>分类</a>
                <a href="#" class="m-item item m-mobile-hide"><i class=" tags icon"></i>标签</a>
                <a href="#" class="m-item item m-mobile-hide"><i class=" clone icon"></i>归档</a>
                <a href="#" class="m-item item m-mobile-hide"><i class=" info icon"></i>关于我</a>
                <div class="right item m-mobile-hide">
                    <div class="ui icon inverted transparent input">
                        <input type="text" placeholder="Search...">
                        <i class="search link icon"></i>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui icon black button m-top-right m-mobile-show" id="m-mobile-show">
            <i class="sidebar icon"></i>
        </a>
    </nav>
    <!--中间部分-->
    <div class="m-container m-padded-tb-big">
        <div class="ui container">  
            <div class="ui stackable grid ">
                <!--左边博客列表-->
                <div class="eleven wide column">
                    <!--头-->
                    <div class="ui teal top attached segment">
                        <div class="ui middel aligned two column grid">
                            <div class="column">
                                <h3 class="ui teal header">博客</h3>
                            </div>
                            <div class="column right aligned">
                                共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${page.totalElements}"> 14 </h2>  篇 博 客
                            </div>
                        </div>
                    </div>
                    <!--content-->
                    <div class="ui attached segment">

                        <div class="ui padded vertical segment m-padded-tb-large" th:each="blog : ${page.content}">
                            <div class="ui middle aligned mobile reversed stackable grid" >
                                <div class="ui mini eleven wide column">
                                    <h3 class="ui header"><a href="#" th:href="@{/blog/{id}(id=${blog.id})}" class="m-black" th:text="${blog.title}" target="_blank">你真的理解财富吗</a></h3>
                                    <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank"  class="m-text m-black"  th:text="${blog.blogInfo}">在深圳宝安区福永街道凤凰山脚下，有一个南宋民族英雄文天祥后代的聚集地，一个拥有700多年历史的古老村落——凤凰古村，当深圳这个昔日的小渔村已成为举世瞩目的大都市后，凤凰古村却依然像一个大家闺秀，不被外界的繁华和喧嚣所诱惑，默默地坚守着......</a>
                                    <div class="ui stackable grid">
                                        <div class="ui eleven wide column">
                                            <div class="ui mini horizontal link list">
                                                <div class="item">
                                                    <img src="https://picsum.photos/100/100?image=1036" alt="" class="ui avatar image" th:src="@{#{index.me}}">
                                                    <div class="content"><a class="header" th:text="${blog.user.nickname}">ming</a></div>
                                                </div>
                                                <div class="item">
                                                    <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2021-06-11</span>
                                                </div>
                                                <div class="item">
                                                    <i class="eye icon"></i><span th:text="${blog.views}">6896</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="right aligned five wide column">
                                            <a href="#" class="ui teal basic label m-padding-mini m-text-thin" target="_blank" th:text="${blog.type.name}">认知升级</a>
                                        </div>
                                    </div>
                                </div>
                                <div class="ui five wide column">
                                    <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target="_blank">
                                        <img src="https://picsum.photos/800/400?image=1037" alt="" class="ui rounded image" th:src="@{${blog.firstPicture}}">
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--footer-->
                    <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
                        <div class="ui middel aligned two column grid">
                            <div class="column">
                               <a href="#" th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}" class="ui mini teal basic button">上一页</a>
                            </div>
                            <div class="column right aligned">
                                <a href="#" th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}" class="ui mini teal basic button">下一页</a>
                            </div>
                        </div>    
                    
                    </div>
                </div>
                <!--右边top-->
                <div class="five wide column">
                    <!--分类-->
                    <div class="ui segments">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column"><i class="idea icon"></i>分类</div>
                                <div class="right aligned column">
                                    <a href="#"  target="_blank" th:href="@{/types/-1}">more <i class="angle double right icon"></i></a>
                                </div>
                            </div>
                        </div>
                        <div class="ui teal segment" >
                            <div class="ui fluid vertical menu" >
                                <a href="#" class="item" th:href="@{/types/{id}(id=${type.id})}" th:each="type: ${types}"><span th:text="${type.name}"></span>
                                    <div class="ui teal basic left pointing label" th:text="${#arrays.length(type.blogs)}">13</div>
                                </a>
                            </div>
                            <!--/*-->
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item" th:href="@{/types/{id}(id=${type.id})}">学习日志
                                    <div class="ui teal basic left pointing label">13</div>
                                </a>
                            </div>
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item">学习日志
                                    <div class="ui teal basic left pointing label">13</div>
                                </a>
                            </div>
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item">学习日志
                                    <div class="ui teal basic left pointing label">13</div>
                                </a>
                            </div>
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item">学习日志
                                    <div class="ui teal basic left pointing label">13</div>
                                </a>
                            </div>
                            <div class="ui fluid vertical menu">
                                <a href="#" class="item">学习日志
                                    <div class="ui teal basic left pointing label">13</div>
                                </a>
                            </div>
                            <!--*/-->

                        </div>
                    </div>
                    <!--标签-->
                    <div class="ui segments m-margin-top-large">
                        <div class="ui secondary segment">
                            <div class="ui two column grid">
                                <div class="column"><i class="tags icon"></i>标签</div>
                                <div class="right aligned column">
                                    <a href="#" target="_blank" th:href="@{/tags/-1}">more <i class="angle double right icon"></i></a>
                                </div>
                            </div>
                        </div>
                        <div class="ui teal segment">
                            <a href="#" th:href="@{/tags/{id}(id=${tag.id})}" class="ui teal basic left pointing label m-margin-tiny" th:each="tag : ${tags}">
                                <span th:text="${tag.name}">方法论</span> <div class="detail" th:text="${#arrays.length(tag.blogs)}">23</div></a>
                        </div>
                    </div>
                    <!--最新推荐-->
                    <div class="ui segments m-margin-top-large">
                        <div class="ui secondary segment">
                            <i class="bookmark icon"></i>--最新推荐--
                        </div>
                        <div class="ui   segment" th:each="blog : ${recommend}">
                            <a href="#" th:href="@{/blog/{id}(id=${blog.id})}" target ="_blank" class="m-black m-text-thin" th:text="${blog.title}">青春故事</a>
                        </div>


                    </div>
                    <!--二维码-->
                    <div class="ui horizontal divider header m-margin-top-large">扫码关注我</div>
                    <div class="ui centered  card" style="width: 11em;">
                        <img src="../static/images/wechat.png" alt="" th:src="@{images/wechat.png}" class="ui rounded image" >
                    </div>
                </div>
            </div>
        </div>
      
    </div>
    <script>
        //"https://unpkg.com/live2d-widget-model-koharu@1.0.5/assets/koharu.model.json",// 小可爱（女）
        //"https://unpkg.com/live2d-widget-model-haruto@1.0.5/assets/haruto.model.json",// 小可爱（男）
        //"https://unpkg.com/live2d-widget-model-chitose@1.0.5/assets/chitose.model.json",// 小帅哥
        //"https://unpkg.com/live2d-widget-model-miku@1.0.5/assets/miku.model.json",// 初音
    </script>
    <script src="https://eqcn.ajz.miesnfu.com/wp-content/plugins/wp-3d-pony/live2dw/lib/L2Dwidget.min.js"></script>
    <script>
        var jsonModel = [
            "https://unpkg.com/live2d-widget-model-shizuku@1.0.5/assets/shizuku.model.json",// 萌娘

        ];
        L2Dwidget.init({
            "model": {
                "jsonPath": jsonModel[Math.floor(Math.random()*(jsonModel.length-1))],
                "scale": 1
            },
            "display": {
                "position": "left", // 位置left、right
                "width": 66, // 宽度
                "height":100, // 高度
                "hOffset": 20, // 横向边距
                "vOffset": 20 // 众向边距
            },
            "mobile": {
                "show": false // 手机是否显示
            },
        });
    </script>
    <!--底部-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive">
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid m-text-spaced m-opacity-mini">
                <div class="three wide column list">
                    <a href="#" class="item">
                        <img src="../static/images/wechat.png" th:src="@{images/wechat.png}" class ="ui rounded image" alt="">
                    </a>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header">最新博客</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">用户故事(User Story)</a>
                        <a href="#" class="item">用户故事(User Story)</a>
                        <a href="#" class="item">用户故事(User Story)</a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">Email:minghui@qq.com</a>
                        <a href="#" class="item">QQ: 3268693203</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header">Blog</h4>
                    <p class="m-text-thin">企鹅舞人情味儿去玩儿去玩儿</p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-thin m-text-spaced m-opacity-tiny">Copyrigh @2021-2022 Designed by Ming</p>
        </div>
    
    
    </footer>
</body>
<script>
    $("#m-mobile-show").click(function(){
        $(".m-item").toggleClass('m-mobile-hide')
    })
</script>
<script>
    $('#newBlogContainer').load(/*[[@{/footer/newblog}]]*/"/footer/newblog");
</script>
<script>
    !function(){

        function n(n,e,t){

            return n.getAttribute(e)||t

        }

        function e(n){

            return document.getElementsByTagName(n)

        }

        function t(){

            var t=e("script"),o=t.length,i=t[o-1];

            return{

                l:o,z:n(i,"zIndex",-1),o:n(i,"opacity",.5),c:n(i,"color","0,0,0"),n:n(i,"count",99)

            }

        }

        function o(){

            a=m.width=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,

                c=m.height=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight

        }

        function i(){

            r.clearRect(0,0,a,c);

            var n,e,t,o,m,l;

            s.forEach(function(i,x){

                for(i.x+=i.xa,i.y+=i.ya,i.xa*=i.x>a||i.x<0?-1:1,i.ya*=i.y>c||i.y<0?-1:1,r.fillRect(i.x-.5,i.y-.5,1,1),e=x+1;e<u.length;e++)n=u[e],

                null!==n.x&&null!==n.y&&(o=i.x-n.x,m=i.y-n.y,

                    l=o*o+m*m,l<n.max&&(n===y&&l>=n.max/2&&(i.x-=.03*o,i.y-=.03*m),

                    t=(n.max-l)/n.max,r.beginPath(),r.lineWidth=t/2,r.strokeStyle="rgba("+d.c+","+(t+.2)+")",r.moveTo(i.x,i.y),r.lineTo(n.x,n.y),r.stroke()))

            }),

                x(i)

        }

        var a,c,u,m=document.createElement("canvas"),

            d=t(),l="c_n"+d.l,r=m.getContext("2d"),
            x=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||

                function(n){

                    window.setTimeout(n,1e3/45)

                },

            w=Math.random,y={x:null,y:null,max:2e4};m.id=l,m.style.cssText="position:fixed;top:0;left:0;z-index:"+d.z+";opacity:"+d.o,e("body")[0].appendChild(m),o(),window.onresize=o,

            window.onmousemove=function(n){

                n=n||window.event,y.x=n.clientX,y.y=n.clientY

            },

            window.onmouseout=function(){

                y.x=null,y.y=null

            };

        for(var s=[],f=0;d.n>f;f++){

            var h=w()*a,g=w()*c,v=2*w()-1,p=2*w()-1;s.push({x:h,y:g,xa:v,ya:p,max:6e3})

        }

        u=s.concat([y]),

            setTimeout(function(){i()},100)

    }();
</script>
</html>